import createAxios from '/@/utils/axios'

const controllerUrl:string = '/classify/'

export function list(): ApiPromise {
    return createAxios({
        url: controllerUrl,
        method: 'GET'
    }) as ApiPromise
}

export function detail(id: number): ApiPromise {
    return createAxios({
        url: controllerUrl + id,
        method: 'GET'
    }) as ApiPromise
}

export function add(data: anyObj): ApiPromise {
    return createAxios({
        url: controllerUrl,
        data: data,
        method: 'POST'
    }) as ApiPromise
}

export function edit(id:number,data: anyObj): ApiPromise {
    return createAxios({
        url: controllerUrl + id,
        data: data,
        method: 'PATCH'
    }) as ApiPromise
}

export function del(id: number): ApiPromise {
    return createAxios({
        url: controllerUrl + id,
        method: 'DELETE'
    }) as ApiPromise
}